﻿import $ = require("jquery");
import ko = require("knockout");

class Tap {
    public static create() {
        ko.bindingHandlers.Tap = {
            init: (element, valueAccessor: () => KnockoutObservable<number>|any) => {
                var callback = valueAccessor();
                $(element).on("manip.tap", (event, args: { offsetX: number; offsetY: number }) => {
                    callback(args);
                });
            },
            update: () => { }
        }
    }
}

export = Tap;